/*
 * 
 * 
 * 
 */
package com.hboxs.asl.entity;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * Entity - 主播分佣记录
 */
@Entity
@Table(name = "xx_anchor_trade")
@SequenceGenerator(name = "sequenceGenerator", sequenceName = "xx_anchor_trade_sequence")
public class AnchorTrade extends BaseEntity {

    private static final long serialVersionUID = -6209590629126922215L;

    /**
     * 流水号
     */
    private String tn;

    /**
     * 主播
     */
    private Member anchor;

    /**
     * 分佣资金
     */
    private BigDecimal amount;

    /**
     * 消费下级
     */
    private Member child;

    /**
     * 购买产品信息
     */
    private String productMsg;

    /**
     * 订单分销记录
     */
    private PointTrade pointTrade;

    @ManyToOne(fetch = FetchType.LAZY)
    public PointTrade getPointTrade() {
        return pointTrade;
    }

    public void setPointTrade(PointTrade pointTrade) {
        this.pointTrade = pointTrade;
    }

    public AnchorTrade(){
        super();
    }

    public AnchorTrade(String tn, Member anchor, BigDecimal amount, Member child, String productMsg) {
        this.tn = tn;
        this.anchor = anchor;
        this.amount = amount;
        this.child = child;
        this.productMsg = productMsg;
    }

    public String getTn() {
        return tn;
    }

    public void setTn(String tn) {
        this.tn = tn;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public Member getAnchor() {
        return anchor;
    }

    public void setAnchor(Member anchor) {
        this.anchor = anchor;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public Member getChild() {
        return child;
    }

    public void setChild(Member child) {
        this.child = child;
    }

    public String getProductMsg() {
        return productMsg;
    }

    public void setProductMsg(String productMsg) {
        this.productMsg = productMsg;
    }
}